Check return of new_domain inside dom0_init, avoiding segfault if there is
authorEwan Mellor <ewan@xensource.com>
Wed, 13 Dec 2006 11:13:08 +0000 (11:13 +0000)
committerEwan Mellor <ewan@xensource.com>
Wed, 13 Dec 2006 11:13:08 +0000 (11:13 +0000)
a second instance of xenstored running (and we're using different pid files).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/xenstore/xenstored_domain.c

index d21ae7b9c70c40afba6c073dcf8c9faba83a176e..75ff6e96d8939892facb0fa32388f9e7ed477773 100644 (file)
@@ -459,6 +459,8 @@ static int dom0_init(void)
                return -1;
 
        dom0 = new_domain(NULL, 0, port); 
+       if (dom0 == NULL)
+               return -1;
 
        dom0->interface = xenbus_map();
        if (dom0->interface == NULL)